{include file="public/head"}
<style>
    .x-body {
        min-width: 900px;
    }

    body {
        overflow-x: scroll;
    }
</style>
<body>
<div class="x-body">
    <div class="lotus-nav">
        <button class="layui-btn layui-btn-sm"
                onclick="x_admin_show('添加用户','{:url(\'admin/user/addCompany\')}',500)">
            <i class="layui-icon layui-icon-add-circle"></i>新建
        </button>

        <div class="layui-input-inline">
            <input id="name" name="name" class="layui-input lotus-input" placeholder="请输入公司名搜索" value="{$Think.get.name}">
        </div>

        <button class="layui-btn layui-btn-sm" onclick="search()"><i class="layui-icon layui-icon-search"></i></button>

        <span class="x-right">
            共有数据:<i class="i_count">
            {if count($list)>0}
            {$data->total()}
            {else/}
            0
            {/if}
        </i>条
            <button onclick="javascript:location.reload()" class="layui-btn-default ">
                <i class="layui-icon layui-icon-refresh"></i>
            </button>
        </span>

    </div>


    <table class="layui-table">
        <thead>
        <tr>
            <th style="width: 40px;text-align: center"></th>
            <th style="text-align:center">公司名称</th>
            <th style="width: 110px;text-align:center">总容量</th>
            <th style="width: 110px;text-align:center">已使用</th>
            <th style="text-align: center;width: 40px">状态</th>
            <th>已使用百分比</th>
            <th style="width: 40px;text-align:center">操作</th>
        </thead>
        <tbody>

        {volist name="list" id="vo"}
        <tr>
            <td style="text-align:center">{$i}</td>
            <td>{$vo.name}</td>
            <td style="text-align:center">{$vo.upload_capacity}GB</td>
            <td style="text-align:center">{$vo.use_capacity}</td>
            <td style="text-align: center">
                {if $vo['status'] == 2}
                <b style="color: red">禁用</b>
                {else/}
                <b style="color: green">启用</b>
                {/if}
            </td>
            <td>
                {$vo.bar}
                <div class="layui-progress layui-progress-big">
                    <div class="layui-progress-bar" lay-percent="{$vo.bar}"></div>
                </div>
            </td>
            <td style="text-align:center">
                <button class="layui-btn layui-btn-xs"
                        onclick="x_admin_show('编辑','info.html?id={$vo.id}','500')">编辑
                </button>
            </td>
        </tr>
        {/volist}

        </tbody>
    </table>
    {if count($list)>0}
    <div class="page">
        <div>
            {$data->render()}
        </div>
    </div>
    {/if}
</div>
</body>
{include file="public/foot"}
<script>
    function search() {
        var name = $("#name").val();
        location.href = "list.html?name=" + name;
    }
</script>
